package cn.bytecollege.controller;
import cn.bytecollege.service.UserMessageService;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
@WebServlet(name = "UserMessageUpdateController", value = "/userMessageUpdate")
public class UserMessageUpdateController extends HttpServlet {
    UserMessageService userMessageService=null;
    public UserMessageUpdateController(){
        userMessageService=new UserMessageService();
    }
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id=request.getParameter("id");
        Integer index=Integer.parseInt(id);
        userMessageService.update(index);
        response.sendRedirect(request.getContextPath()+"/userMessageList");
    }
}
